Skip to content

refactor: logging environment variables - #43

Open
yCodeTech wants to merge 4 commits into
feat/logging-levelsfrom
refactor/logging-environment-variables
Open

refactor: logging environment variables#43
yCodeTech wants to merge 4 commits into
feat/logging-levelsfrom
refactor/logging-environment-variables

Conversation

@yCodeTech

@yCodeTech yCodeTech commented Aug 4, 2026

Copy link
Copy Markdown
Owner

This pull request updates the way environment and extension path information is logged in the Configuration class, streamlining the debug output and focusing on relevant environment variables. The most important changes are:

Environment and Extension Path Logging:

  • Removed the logging of the extension discovery paths from the logDebugInfo method as these are also logged in extension.ts, so they're technically redundant in the method.
  • Added logging of the App Root and filtered environment variables (only those starting with VSCODE_) under Env Vars in the environment details, making the debug output more focused and relevant in logDebugInfo method.

Removal of dumping system environment variables into the logs

  • Removed logging of the dumped system environment variables as they could potentially have some sensitive information like environment passwords, auth keys, etc. Majority of it wasn't relevant to debugging anyway.

…s.env.

The env variables could potentially have some sensitive information, so we shouldn't dump all env vars. The majority of them don't seem to be useful for debugging anyway.

- Removed dumping `process.env`.
- Added handpicked env vars to be logged in `logDebugInfo` Configuration method:
    - VScode's `appRoot` env var.
    -  Env vars that start with `VSCODE_` in `process.env`.
- Removed logging of the extension discovery paths as they are already logged from the extension file, so these are redundant.

- Added code comments to the various debug logs to make it easier to scan read.
Copilot AI review requested due to automatic review settings August 4, 2026 02:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors Configuration.logDebugInfo() to adjust what environment-related information is emitted in debug logs, focusing on VS Code-specific environment details rather than dumping broad environment state.

Changes:

  • Removed logging of extension discovery paths (including WSL-specific paths) from the debug “Environment” payload.
  • Added logging of vscode.env.appRoot and a filtered set of process.env entries limited to VSCODE_* variables.
  • Reorganized debug-log sections with additional inline headings for language config-related logs.

Comment thread src/configuration.ts Outdated
`process.env` values are typed as `string|undefined` and `undefined` isn't assignable to `JsonValue` in the `JsonObject` of the env object. So we need a type predicate to make sure the entry IS string, and a type guard to discard any values that are undefined.

- Fixed the logging of environment variables filter to ensure that only string values are included for keys starting with "VSCODE_".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants